package Others.DesignPattern.SimpleFactoryPattern.Pattern.CalculateSimpleFactory;

import Others.DesignPattern.SimpleFactoryPattern.Pattern.Calculate.*;

public class CalculateSimpleFactory {

    public static Operation createOperation(String operation) {

        Operation opera = null ;
        switch(operation){
            case "+":
                opera = new OperationAdd();
                break;
            case "-":
                opera = new OperationSub();
                break;
            case "*":
                opera = new OperationMul();
                break;
            case "/":
                opera = new OperationDiv();
                break;
            default:
                break;
        }
        return opera;
    }

}
